package base.java9_17;

import java.security.SecureRandom;
import java.util.Random;
import java.util.SplittableRandom;
import java.util.concurrent.ThreadLocalRandom;
import java.util.random.RandomGenerator;
import java.util.random.RandomGeneratorFactory;

/**
 * 提供更好的随机数生成
 * * {@link RandomGenerator}
 * * {@link RandomGeneratorFactory}
 * <p>
 * 算法名称
 * * {@link SecureRandom}
 * * {@link Random}
 * * {@link ThreadLocalRandom}
 * * {@link SplittableRandom}
 *
 * @author 王霄
 * @date 2021/9/27 9:28
 **/
public class RandomGeneratorDemo {
    public static void main(String[] args) {
        RandomGenerator.of("SecureRandom")
                .doubles()
                .limit(10)
                .sorted()
                .forEach(System.out::println);
    }
}
